/**************************************************************************************************
  Filename:       simpleGATTprofile.h
  Revised:
  Revision:

  Description:    This file contains the Simple GATT profile definitions and
                  prototypes.

 **************************************************************************************************/

#ifndef _BLE_UART_SERVICE_H
#define _BLE_UART_SERVICE_H

#ifdef __cplusplus
extern "C"
{
#endif


#include <stdint.h>
#include <stdbool.h>


#include "config.h"



#define BLE_UART_RX_BUFF_SIZE                  1


typedef enum {
    BLE_UART_EVT_TX_NOTI_DISABLED = 1,
    BLE_UART_EVT_TX_NOTI_ENABLED,
    BLE_UART_EVT_BLE_DATA_RECIEVED,
} ble_uart_evt_type_t;

typedef struct {
    uint8_t const * p_data; /**< A pointer to the buffer with received data. */
    uint16_t        length; /**< Length of received data. */
} ble_uart_evt_rx_data_t;

typedef struct {
    ble_uart_evt_type_t  type;
    ble_uart_evt_rx_data_t  data;
} ble_uart_evt_t;

typedef void (*ble_uart_ProfileChangeCB_t)(uint16_t connection_handle,ble_uart_evt_t* p_evt);



/*********************************************************************
 * API FUNCTIONS
 */


/*
 * ble_uart_AddService- Initializes the raw pass GATT Profile service by registering
 *          GATT attributes with the GATT server.
 *
 * @param   services - services to add. This is a bit map and can
 *                     contain more than one service.
 */

extern bStatus_t ble_uart_add_service( ble_uart_ProfileChangeCB_t cb);




extern uint8 ble_uart_notify_is_ready(uint16 connHandle);

extern bStatus_t ble_uart_notify( uint16 connHandle, attHandleValueNoti_t *pNoti, uint8 taskId );
bStatus_t ble_send( uint16_t connHandle, uint8_t *data, uint16_t length);
uint8_t   ble_uart_enable_notify(uint16_t connection_handle,bool enable) ;
/*********************************************************************
*********************************************************************/

#ifdef __cplusplus
}
#endif

#endif /* _BLE_UART_SERVICE_H */

